{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
}}

{{#if this.model.exportError}}
  <Clients::Counts::Error
    @title={{if (eq this.model.exportError.message "No data to export in provided time range.") "No data found"}}
    @error={{this.model.exportError}}
  >
    <:actions>
      {{#if (eq this.model.exportError.httpStatus 403)}}
        <Hds::Text::Body @tag="p" @color="faint">
          Viewing export data requires
          <Hds::Text::Code class="code-in-text">sudo</Hds::Text::Code>
          permissions.
          <Hds::Link::Standalone
            @icon="docs-link"
            @iconPosition="trailing"
            @text="Client Export Documentation"
            @href={{doc-link "/vault/api-docs/secret/databases"}}
          />
        </Hds::Text::Body>
      {{/if}}
    </:actions>
  </Clients::Counts::Error>
{{else}}
  <Clients::Page::ClientList
    @exportData={{this.model.exportData}}
    @onFilterChange={{this.countsController.updateQueryParams}}
    @filterQueryParams={{hash
      namespace_path=this.countsController.namespace_path
      mount_path=this.countsController.mount_path
      mount_type=this.countsController.mount_type
    }}
  />
{{/if}}